function updateDept() {
    var tips_edit_dept = $MB.i18n('tips.edit.dept'),
        tips_edit_dept_msg = $MB.i18n('tips.edit.dept.msg'),
        dept_edit_title = $MB.i18n('dept.update');
    var selected = $("#deptTable").bootstrapTreeTable("getSelections");
    var selected_length = selected.length;
    if (!selected_length) {
        $MB.n_warning(tips_edit_dept);
        return;
    }
    if (selected_length > 1) {
        $MB.n_warning(tips_edit_dept_msg);
        return;
    }
    var deptId = selected[0].id;
    $.post(ctx + "dept/getDept", {"deptId": deptId}, function (r) {
        if (r.code === 0) {
            var $form = $('#dept-add');
            var $deptTree = $('#deptTree');
            $form.modal();
            var dept = r.msg.dept;
            $("#dept-add-modal-title").html(dept_edit_title);
            $form.find("input[name='deptName']").val(dept.deptName);
            $form.find("input[name='oldDeptName']").val(dept.deptName);
            $form.find("input[name='deptId']").val(dept.deptId);
            $deptTree.jstree('select_node', dept.parentId, true);
            $deptTree.jstree('disable_node', dept.deptId);//不能是自己
            var $meetingroomTree = $('#meetingRoomTree');
            var meetingroom = r.msg.deptMeetingrooms;
//          var meetingroomArr = [];  [edit start] jinhui.li 20181218
            for (var i = 0; i < meetingroom.length; i++) {
//            	meetingroomArr.push(meetingroom[i].meetingRoomId);
            	if(!$meetingroomTree.jstree('is_parent', meetingroom[i].meetingRoomId)){
            		$meetingroomTree.jstree('select_node', meetingroom[i].meetingRoomId, true);
            	} 
            }
//            $meetingroomTree.jstree('select_node', meetingroomArr, true);
            $meetingroomTree.jstree().close_all();
            
            var $menuTree = $('#menuTree');
            var roleMenus = r.msg.roleMenus;
//            var menuArr = [];
            for (var i = 0; i < roleMenus.length; i++) {
//                menuArr.push(roleMenus[i].menuId);
                if(!$menuTree.jstree('is_parent', roleMenus[i].menuId)){
                	$menuTree.jstree('select_node', roleMenus[i].menuId, true);
            	}
            }
//            $menuTree.jstree('select_node', menuArr, true);[edit end] jinhui.li 20181218
            $menuTree.jstree().close_all();
            
            $("#dept-add-button").attr("name", "update");
        } else {
            $MB.n_danger(r.msg);
        }
    });
}